package com.milkyTea.Services;


import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.milkyTea.Dao.MessageDao;



@WebServlet("/MessageServlet")
public class MessageServlet extends HttpServlet {
	
       MessageDao messagedao=new MessageDao();
       
	protected void service(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException {
		
		 String username = request.getParameter("username").toString();
			String  tel= request.getParameter("tel").toString() ;
			String email= request.getParameter("email").toString();
	 	String content= request.getParameter("content").toString();
		int i=messagedao.add(username, tel, email, content);
		PrintWriter out=response.getWriter();
		out.print(i);
		out.flush();
		out.close();
	}



}
